/**
 * @author Akos Szabo - Axi
 * Jan 8, 2012
 */
package com.axi.util;

import java.util.Vector;

/**
 * @author Akos Szabo - Axi
 * 
 * This vector vary allows to cut a vector by keeping the inside array structure.
 * It is quick, saves memory and time of reallocation and copy.
 *
 */
public class VectorCutable extends Vector
{

	public VectorCutable(int argSize)
	{
		super(argSize);
	}

	/**
	 * Cut the left size of the Vector. Cut till the size is the new size.
	 * The cut content is lost.
	 * @param argNewSize
	 */
	public void cutLeft(int argNewSize)
	{
		int from = elementCount-argNewSize;
		for(int i=0; i<argNewSize;i++)
		{
			elementData[i]=elementData[from + i];
			elementData[from + i]=null;			
		}
		elementCount = argNewSize;
	}
	
}//end of class
